package model

import "time"

type Delivery struct {
	Id             uint64    `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	RiderId        int32     `gorm:"column:rider_id;type:int(10);comment:骑手id;not null;" json:"rider_id"`                    // 骑手id
	TrackingNumber string    `gorm:"column:tracking_number;type:varchar(255);comment:快递号;not null;" json:"tracking_number"` // 快递号
	CabinetId      int32     `gorm:"column:cabinet_id;type:int(10);comment:快递柜id;not null;" json:"cabinet_id"`              // 快递柜id
	State          int32     `gorm:"column:state;type:int(10);comment:状态 0待收货 1已收货 2 滞留;not null;" json:"state"`     // 状态 0待收货 1已收货 2 滞留
	CreateTime     time.Time `gorm:"column:create_time;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"create_time"`
	UpdateTime     time.Time `gorm:"column:update_time;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"update_time"`
}

func (d Delivery) TableName() string {
	return "delivery"
}
